<?php
/**
*
* 功能描述（主页数据）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*/

class ModelConf extends ModelBase
{
	function GetConf()
	{
		$cur_conf = $this->GetSysConf('index_img');
		$data = array('index_img' => $cur_conf);
		return $data;
	}

	function UpdateConf($id, $data)
	{
		return $this->db->Update('sys_conf', $data, "id = $id");
	}

	function AddConf($data)
	{
		return $this->db->Insert('sys_conf', $data);
	}

	function DelConf($id)
	{
		return $this->db->Delete('sys_conf', "id = $id");
	}

	function ImgCnt()
	{
		$data = $this->db->GetRow('sys_conf', 'count(1) cnt', "`key` = 'index_img'");
		return $data['cnt'];
	}
}

